﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria.GameContent.UI.Elements;
using Terraria.UI;

namespace Terraria.ModLoader.UI
{
	// Token: 0x0200028E RID: 654
	internal class UILoadProgress : UIPanel
	{
		// Token: 0x06001A73 RID: 6771 RVA: 0x00429554 File Offset: 0x00427754
		public UILoadProgress()
		{
			this.text = new UIText("", 0.75f, true);
			this.text.Top.Set(20f, 0f);
			this.text.HAlign = 0.5f;
			base.Append(this.text);
			this.progress = 0f;
		}

		// Token: 0x06001A74 RID: 6772 RVA: 0x004295C0 File Offset: 0x004277C0
		protected override void DrawSelf(SpriteBatch spriteBatch)
		{
			base.DrawSelf(spriteBatch);
			CalculatedStyle innerDimensions = base.GetInnerDimensions();
			spriteBatch.Draw(Main.magicPixel, new Rectangle((int)innerDimensions.X + 10, (int)innerDimensions.Y + (int)innerDimensions.Height / 2 + 20, (int)innerDimensions.Width - 20, 10), new Rectangle?(new Rectangle(0, 0, 1, 1)), new Color(0, 0, 70));
			spriteBatch.Draw(Main.magicPixel, new Rectangle((int)innerDimensions.X + 10, (int)innerDimensions.Y + (int)innerDimensions.Height / 2 + 20, (int)((innerDimensions.Width - 20f) * this.progress), 10), new Rectangle?(new Rectangle(0, 0, 1, 1)), new Color(200, 200, 70));
		}

		// Token: 0x06001A75 RID: 6773 RVA: 0x00012DF0 File Offset: 0x00010FF0
		internal void SetText(string text)
		{
			this.text.SetText(text, 0.75f, true);
		}

		// Token: 0x06001A76 RID: 6774 RVA: 0x00012E04 File Offset: 0x00011004
		internal void SetProgress(float progress)
		{
			this.progress = progress;
		}

		// Token: 0x040017A3 RID: 6051
		private UIText text;

		// Token: 0x040017A4 RID: 6052
		private float progress;
	}
}
